package io;

import java.io.*;

/**
 * 使用对象输入流对对象反序列化操作
 */
public class OIsDemo {
    public static void main(String[] args) throws IOException, ClassNotFoundException {
        //获取文件
        FileInputStream fis = new FileInputStream("person.obj");
        //连上高级流 对象输入流
        ObjectInputStream ois = new ObjectInputStream(fis);
        Person o = (Person) ois.readObject();//向上造型
        System.out.println(o);
        ois.close();
    }
}
